﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mayn.Video
{
    public class WmsVideoScanDal : BaseDal<WmsVideoScan>
    {

        public int videoEnd(WmsVideoScan entity, double videoTime, string path)
        {
            entity.PATH = path;
            entity.VIDEO_TIME = videoTime.ToString();
            entity.VIDEO_END = DateTime.Now;
            entity.STATUS = (int)VidoStatusEnum.Record;
            return Update(entity);
        }

        public int updateDel(WmsVideoScan entity)
        {
            entity.DEL = 1;
            return Update(entity);
        }

        public WmsVideoScan InsertScan(string so, string ip, string type, string creator)
        {
            WmsVideoScan entity = new WmsVideoScan();
            entity.IP = ip;
            entity.ORDER_NO = so;
            entity.STATUS = (int)VidoStatusEnum.Initial;
            entity.CREATETIME = DateTime.Now;
            entity.VIDEO_START = DateTime.Now;
            entity.TYPE = type;
            entity.CREATOR = creator;
            entity.DEL = 0;

            return AddReturnEntity(entity);
        }
    }
}
